package com.authine.cloudpivot.ext.enums.commoditymaterials;

/**
 * Created by Kris on 2019/3/25
 */
public enum DeliverNoticeEnum {

    ALL(0, "全部"),
    NEW(1, "新建"),
    SUBMIT(2, "已提交"),
    CLOSE(3, "关闭"),
    PART_DELIVERD(4, "部分发货"),
    DELIVERD(5, "已发货");

    public Integer id;
    public String text;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    DeliverNoticeEnum(Integer id, String text) {

        this.id = id;
        this.text = text;
    }

    public static DeliverNoticeEnum get(Integer code) {

        for (DeliverNoticeEnum c : DeliverNoticeEnum.values()) {
            if (c.id.toString().equals(code.toString())) {
                return c;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return text;
    }
}
